<%@page import="helpers.UrlHelper"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%
String keyword = (String) request.getAttribute("keyword");
String name = (String) request.getAttribute("name");
String type = (String) request.getAttribute("type");
List<String> sites = (List<String>) request.getAttribute("sites");
List<String> order = (List<String>) request.getAttribute("order");
List<String> pages = (List<String>) request.getAttribute("pages");

//Set seo content
String title = "Check Order Keyword";
String description = "Check the website keyword ranking on google search engine.";
String url = UrlHelper.getServerUrl(request) + "/tool/order-keyword";
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

			<div class="row-fluid">
            
            	<!-- tool detail
        		================================================== -->
            	<div class="span8">
                	<h3 class="toolName">Check Order Keyword</h3>
                    <p class="toolDesc">Check the website keyword ranking on google search engine. </p>
                    
                    <!-- form check
        			================================================== -->
                    <form method="get" action="" class="form-inline">
                    	<input type="text" value="<%=name != null ? name  : "" %>" name="name" placeholder="Enter your domain" class="input-xlarge"/>
                    	<input type="text" value="<%=keyword != null ? keyword : "" %>" name="keyword" placeholder="Enter your keyword" class="input-xlarge"/>
                        <button type="submit" class="btn btn-info">Check</button>
                        
                        <div class="radioGroup row-fluid content-center">
                        	<div class="span3">
                            	<p>www.google.com</p>
                            	<input type="radio" id="radio-1-1" class="regular-radio" value="www.google.com" name="type" <%=(type == null || type.equalsIgnoreCase("www.google.com")) ? "checked" : "" %>/><label for="radio-1-5"></label><br />
                            </div>
                        	<div class="span3">
                            	<p>www.google.de</p>
                            	<input type="radio" id="radio-1-2" class="regular-radio" value="www.google.de" name="type" <%=(type != null && type.equalsIgnoreCase("www.google.de")) ? "checked" : "" %>/><label for="radio-1-1"></label><br />
                            </div>
                        	<div class="span3">
                            	<p>www.google.ca</p>
                            	<input type="radio" id="radio-1-3" class="regular-radio" value="www.google.ca" name="type" <%=(type != null && type.equalsIgnoreCase("www.google.ca")) ? "checked" : "" %>/><label for="radio-1-2"></label>
                            </div>
                            <div class="span3">
                            	<p>www.google.co.jp</p>
                            	<input type="radio" id="radio-1-4" class="regular-radio" value="www.google.co.jp" name="type" <%=(type != null && type.equalsIgnoreCase("www.google.co.jp")) ? "checked" : "" %>/><label for="radio-1-3"></label><br />
                            </div>
                        </div>
                        <div class="radioGroup row-fluid content-center">
                        	<div class="span3">
                            	<p>www.google.es</p>
                            	<input type="radio" id="radio-1-5" class="regular-radio" value="www.google.es" name="type" <%=(type != null && type.equalsIgnoreCase("www.google.es")) ? "checked" : "" %>/><label for="radio-1-4"></label><br />
                            </div>
                            <div class="span3">
                            	<p>www.google.pl</p>
                            	<input type="radio" id="radio-1-6" class="regular-radio" value="www.google.pl" name="type" <%=(type != null && type.equalsIgnoreCase("www.google.pl")) ? "checked" : "" %>/><label for="radio-1-6"></label><br />
                            </div>
                        	<div class="span3">
                            	<p>www.google.fr</p>
                            	<input type="radio" id="radio-1-7" class="regular-radio" value="www.google.fr" name="type" <%=(type != null && type.equalsIgnoreCase("www.google.fr")) ? "checked" : "" %>/><label for="radio-1-1"></label><br />
                            </div>
                        	<div class="span3">
                            	<p>www.google.com.vn</p>
                            	<input type="radio" id="radio-1-8" class="regular-radio" value="www.google.com.vn" name="type" <%=(type != null && type.equalsIgnoreCase("www.google.com.vn")) ? "checked" : "" %>/><label for="radio-1-2"></label>
                            </div>
                        </div>
                                               
                    </form>
                    
                    <!-- result
        			================================================== -->
       				<% if (!sites.isEmpty()) { %>
                    <div class="toolResult">
                    	<h4>Order Keyword for <%=name %></h4>
                        <hr />
                        
                    	<table class="table table-striped table-bordered">
                    		<thead>
								<tr>
									<th>Url</th>
									<th>Position</th>
									<th>Page</th>
								</tr>
							</thead>
							<tbody>
								<% for (int i = 0; i < sites.size(); i++) { %>
								<tr>
									<td><%=sites.get(i) %></td>
									<td><%=order.get(i) %></td>
									<td><%=pages.get(i) %></td>
								</tr>
								<% } %>
							</tbody>
						</table>
                    	
                    </div>
                    <% } %>
                </div>                
                
                <jsp:include page="/elements/right.jsp" />
                
            </div>


<jsp:include page="/layouts/footer.jsp" />